package com.medical.manage.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.medical.common.core.annotation.Excel;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@TableName("t_comment")
public class Comments {
    //评论id
    @TableId(type = IdType.AUTO)
    private Integer id;
    //医生id
    private Integer doctorId;
    //用户id
    private Long userId;
    //文章id
    private Integer articleId;
    //评论内容
    private String commentContent;
    //父id
    private Integer pid;
    //创建时间
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    //修改时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    //修改人
    private String updatePerson;
    //逻辑删除（0未删，1已删）
    private Integer state;

    @TableField(exist = false)
    //评论子集合
    private List<Comments> commentsList=new ArrayList<>();

    /** 用户昵称 */
    @TableField(exist = false)
    private String nickName;

}